# from tornado import web
# import asyncio
# import os
# from lib.urls import urls
#
#
# BASE_DIR = os.path.dirname(__file__)
#
# settings = {
#     "cookie_secret": "jidkwc/ijuioqwjij75/df.dfs",
#     "static_path": os.path.join(BASE_DIR, "static"),
#     "template_path": os.path.join(BASE_DIR, "templates"),
# }
#
# app = web.Application(urls, **settings)
# app.listen(8001)
#
# loop = asyncio.get_event_loop()
# loop.run_forever()
# coding=utf-8
import asyncio
import os

from tornado import web, options

from lib.urls import urls


options.define("port", default=8001, type=int, help="run on the given port")
BASE_DIR = os.path.dirname(__file__)

settings = {
    "cookie_secret": "jidkwc/ijuioqwjij75/df.dfs",
    "static_path": os.path.join(BASE_DIR, "static"),
    "template_path": os.path.join(BASE_DIR, "templates"),

}

if __name__ == "__main__":
    options.parse_command_line()
    app = web.Application(urls, **settings)
    app.listen(options.options.port)
    loop = asyncio.get_event_loop()
    loop.run_forever()